try:
    s, x = input(), int(input())
    if x < -len(s) or x >= len(s):
        raise ValueError
    else:print(f"{s[x]}")
    print(len(s))
except ValueError:
    print("输入下标有误")




